
def GetJScript():
	
	""" 
	This method returns the currently loaded model as Jarnac Script. 
	"""
	print '\n',util.GetJarnac().replace('\r\n','\n')

def Simulate():
	
	#""" This method performs a short timecourse of the current model. """
  sim.loadSBML(util.GetSBML());
  print sim.simulate();

def SteadyState():
	
	#""" This method calculates the steady state and prints the values of floating species at steady state."""
	
  sim.loadSBML(util.GetSBML());
  print "\nCloseness to steady state (sum of squares): ", sim.steadyState();
  names = sim.getFloatingSpeciesNames();
  values = sim.getFloatingSpeciesConcentration();
  for i in range(0, len(names)):
  	print "    species: ", names[i], " steady state value: ", values[i]

def GetModelOverview():	

  #""" This method prints all species - reactions - parameters of the current model."""
	B = model.BackEndModel;
	print "\n"
	print "The current model is named: ", B.ID
	print "The current model has:      ", str(B.GetNodes().Count), " species"
	for i in range (0,B.GetNodes().Count):
		print "    Name: ", B.GetNodes()[i].ID, " Value: ", B.GetNodes()[i].Concentration, "Boundary Species?:", B.GetNodes()[i].Boundary
	print "The current model has:      ", str(B.GetReactions().Count), " reactions"
	for i in range (0,B.GetReactions().Count):
		print "    Name: ", B.GetReactions()[i].ID, " Kinetic Law: ", B.GetReactions()[i].GetRateForward()
	print "The current model has:      ", str(B.ParameterNames.Count), " parameters"
	for i in range (0,B.ParameterNames.Count):
		print "    Name: ", B.ParameterNames[i], " Value: ", B.ParameterValues[i]


GetModelOverview()
SteadyState()
GetJScript()